﻿using System;
using System.Text;
using System.Windows.Forms;

namespace JSH.ITDiplom.OOPC01.PersonalIdentityNumber.UILayer.WFA
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            try
            {
                Application.Run(new FormMain());
            }
            catch (Exception e)
            {   
                //Catch exceptions and show an error message dialog
                StringBuilder sb = new StringBuilder();
                sb.Append("Fejl tekst: ");
                sb.AppendLine(e.Message);
                sb.AppendLine();
                sb.AppendLine("Stacktrace:");
                sb.Append(e.StackTrace);
                MessageBox.Show(sb.ToString(), "Fejl", MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
        }
    }
}
